<template>
	<div class="model">
		<h2 class="model__title">审核详情<span @click="close" class="model__title--close">&times;</span></h2>
		<div class="model__content" v-loading="loading">
			<div v-if="cash">
				<div class="item" >
					<h2 class="item__title">业务员信息</h2>
					<div class="item__detail item__detail-block">
						<span class="item__detail--title">业务员:</span>
						<img :src="cash.sale_man.head_img" class="item__detail--pic" />
						<span class="item__detail--value">{{cash.sale_man.real_name}}</span>
					</div>
				</div>
				<div class="item" >
					<h2 class="item__title">提现信息</h2>
					<div class="item__detail">
						<span class="item__detail--title">提现金额:</span>
						<span class="item__detail--value">{{cash.cash_money}}</span>
					</div>
					<div class="item__detail">
						<span class="item__detail--title">提现日期:</span>
						<span class="item__detail--value">{{cash.cash_time | formatTime}}</span>
					</div>
					<div class="item__detail" v-if="cash.check_time">
						<span class="item__detail--title">审核日期:</span>
						<span class="item__detail--value">{{cash.check_time | formatTime}}</span>
					</div>
				</div>
				<div class="item" >
					<h2 class="item__title">审核人信息</h2>
					<div class="item__detail item__detail-block">
						<span class="item__detail--title">审核人:</span>
						<img :src="cash.checker.head_img" class="item__detail--pic" />
						<span class="item__detail--value">{{cash.checker.real_name}}</span>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		created(){
			this.fetchManagerDetail();
		},
		props: ["id", "reason"],
		data() {
			return {
				loading: true,
				cash: null
			}
		},
		methods: {
			close() {
				this.$parent.showModel = false;
			},
			fetchManagerDetail() {
				this.loading = true;
				var url = `${this.url}/wallet/cash_get_info.action`;
				var params = {
					token: "3960c4db11d44c018898258d63d95bd0",
					cash_rcd_id: this.id
				};
				this.$http.get(url,{ params }).then((res)=> {
					this.loading = false;
					this.cash = res.data.result;
				});
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>